from log.purchaseLogFactory import PurchaseLogFactory
from log.logManager import LogManager
from user.user import User
from product.product import Product

def main():
    
    user1 = User("小明", 100, 100)
    user2 = User("小红", 100, 100)
    user3 = User("小花", 100, 100)
    user4 = User("小黑", 100, 100)
    user5 = User("小黄", 100, 100)

    product1 = Product("摄影套餐", "套", 15, 100, "点餐页面")
    product2 = Product("猫粮", "袋", 50, 100, "商城页面")
    product3 = Product("宠物养护服务", "箱", 40, 100, "积分兑换页面")
    product4 = Product("猫粮", "箱", 100, 100, "积分兑换页面")
    product5 = Product("体验套餐", "次", 2, 100, "优惠券页面")

    logs = [
        PurchaseLogFactory.create_log(user1, product1, "余额", 2),
        PurchaseLogFactory.create_log(user2, product2, "现金", 1),
        PurchaseLogFactory.create_log(user3, product3, "积分", 1),
        PurchaseLogFactory.create_log(user4, product4, "积分", 3),
        PurchaseLogFactory.create_log(user5, product5, "优惠券", 1)
    ]

    log_manager = LogManager()

    for log in logs:
        log_manager.add_log(log)

    log_manager.show_all_logs()


if __name__ == "__main__":
    main()